<?php

namespace application\model;

use application\entity\db\User;
use core\entity\Criteria;
use core\entity\Query;
use application\model\BaseModel as BaseModel;

class UserModel extends BaseModel {

    public function __construct() {
        parent::__construct(User::class);
    }

    /**
     * Tìm kiếm user theo email
     * @param type $email
     * @return Danh sách user
     */
    public function findByEmail($email = '') {
        $cri = new Criteria();
        $cri->andKey("email")->is($email);
        $query = new Query($cri);
        return $this->ifind($query);
    }

}
